//
//  SpecialStateVC.m
//  sensen_ios
//
//  Created by mc on 16/4/22.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "SpecialStateVC.h"

@interface SpecialStateVC ()

@end

@implementation SpecialStateVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    //修改昵称
    self.title = @"特别说明";
    
    self.view.backgroundColor = [UIColor colorWithRed:0.98 green:0.98 blue:0.98 alpha:1];

    // 导航栏左边返回按钮
    [self createLeftBarButtonItemWithImagename:nil];
    
    
    [self _initView];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    // 导航栏样式
    [self isNaviTranslucent:NO statesLightContent:YES];
    
    // 设置颜色
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:SS_NAVI_ORANGE_COLOR] forBarMetrics:UIBarMetricsDefault];
}


- (void)_initView{
    
    
    UILabel * title = [[UILabel alloc] init];
    [self.view addSubview:title];
    [title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(10);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, 20));
        make.top.equalTo(self.view).offset(10);
    }];
    
    title.text = @"免责声明:";
    title.textColor = [UIColor blackColor];
    title.font = [UIFont systemFontOfSize:18];
    
    UITextView * content = [[UITextView alloc] init];
    [self.view addSubview:content];
    [content mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(10);
        make.right.equalTo(self.view).offset(-10);
        make.top.equalTo(title.mas_bottom).offset(10);
        make.bottom.equalTo(self.view).offset(0);
    }];

    content.text = @"本应用由森森开发或拥有。森森在此申明，用户通过本软件参加的商业活动，与Apple Inc.无关，Apple不承担该程序的任何责任。\n森森休闲手机客户端的品牌合作商，如Apple，AppStore，非森森休闲手机客户端的赞助商，也未拥有该客户端的知识产权或其他任何权益。因森森休闲手机客户端侵犯第三方知识产权的，由森森休闲承担相应的法律责任。\n森森休闲有权但无义务，改善或更正本手机客户端的任何错误或缺陷。\n用户通过森森休闲手机客户端及其中的任何链接、下载获得的一切信息、内容或广告，森森休闲不声明或保证其正确性或可靠性；并且对于用户经本手机客户端上的展示、内容、广告而购买、取得的任何产品、或信息，森森休闲不负保证责任。用户自行承担使用本软件的风险。";
    
    content.editable = NO;
    
    
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:content.text];
    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:5];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [content.text length])];
    [content setAttributedText:attributedString];
    [content sizeToFit];
    
    content.font = [UIFont systemFontOfSize:15];
    content.textColor = [UIColor grayColor];
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
